{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# RemoteDataService\n",
    "\n",
    "## 介绍\n",
    "RemoteDataService是对jaqs底层dataapi的一个高级封装，提供了一些常用数据的快捷查询方法——如K线、交易日历、指数成分信息、行业分类信息等。\n",
    "RemoteDataService可以通过jaqs官方提供的免费数据源直接从网络获取行情数据和参考数据，需要提前去官网注册账号,方可使用。\n",
    "\n",
    "* 如需注册账号-[官方网站](https://www.quantos.org/)\n",
    "* 如需直接使用底层dataapi访问数据-\n",
    "[jaqs底层dataapi文档-官方](http://jaqs.readthedocs.io/zh_CN/latest/user_guide.html#api)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 准备工作\n",
    "\n",
    "\n",
    "*** 步骤: ***\n",
    "\n",
    "- 1.配置数据下载的tcp地址(data_config)--使用jaqs官方提供的免费数据源需要提前去官网注册账号,方可使用\n",
    "- 2.引入模块并实例化、初始化RemoteDataService"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Begin: DataApi login 18566262672@tcp://data.quantOS.org:8910\n",
      "    login success \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'0,'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from jaqs_fxdayu.data import RemoteDataService # 远程数据服务类\n",
    "\n",
    "# step 1 其中，username password分别对应官网注册的账号和序列号\n",
    "data_config = {\n",
    "\"remote.data.address\": \"tcp://data.quantOS.org:8910\", # 数据服务tcp地址\n",
    "\"remote.data.username\": \"18566262672\",# 账号\n",
    "\"remote.data.password\": \"eyJhbGciOiJIUzI1NiJ9.eyJjcmVhdGVfdGltZSI6IjE1MTI3MDI3NTAyMTIiLCJpc3MiOiJhdXRoMCIsImlkIjoiMTg1NjYyNjI2NzIifQ.O_-yR0zYagrLRvPbggnru1Rapk4kiyAzcwYt2a3vlpM\",\n",
    "\"timeout\":180 #超时设置(秒),请求超时会报错\n",
    "}\n",
    "\n",
    "# step 2\n",
    "ds = RemoteDataService()\n",
    "ds.init_from_config(data_config)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## daily\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.daily(symbol, start_date, end_date, fields=\"\", adjust_mode=None) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取日线行情\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SH,600300.SH'|\n",
    "|start_date |是 |int/str |开始时间 YYYMMDD or 'YYYY-MM-DD'|\n",
    "|end_date |是 |int/str |结束时间 YYYMMDD or 'YYYY-MM-DD'|\n",
    "|fields |否 | str |字段 以 ','隔开, 默认 \"\" (包含所有字段)|\n",
    "|adjust_mode |否 | str or None |复权方式 None:不复权; 'post':后复权,默认不复权|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "   \n",
    "   columns:\n",
    "        \n",
    "        symbol, code, trade_date, open, high, low, close, volume, turnover, vwap, oi, suspended\n",
    "   \n",
    "   具体字段含义见quote()方法-返回字段说明\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n",
    "    \n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>code</th>\n",
       "      <th>freq</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>oi</th>\n",
       "      <th>open</th>\n",
       "      <th>preclose</th>\n",
       "      <th>presettle</th>\n",
       "      <th>settle</th>\n",
       "      <th>symbol</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>trade_status</th>\n",
       "      <th>turnover</th>\n",
       "      <th>volume</th>\n",
       "      <th>vwap</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2109.387</td>\n",
       "      <td>000001</td>\n",
       "      <td>1d</td>\n",
       "      <td>2113.110</td>\n",
       "      <td>2101.016</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2112.126</td>\n",
       "      <td>2115.978</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SH</td>\n",
       "      <td>20140102</td>\n",
       "      <td>交易</td>\n",
       "      <td>6.192135e+10</td>\n",
       "      <td>6.848549e+09</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2083.136</td>\n",
       "      <td>000001</td>\n",
       "      <td>1d</td>\n",
       "      <td>2102.167</td>\n",
       "      <td>2075.899</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2101.542</td>\n",
       "      <td>2109.387</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SH</td>\n",
       "      <td>20140103</td>\n",
       "      <td>交易</td>\n",
       "      <td>7.237223e+10</td>\n",
       "      <td>8.449724e+09</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2045.709</td>\n",
       "      <td>000001</td>\n",
       "      <td>1d</td>\n",
       "      <td>2078.684</td>\n",
       "      <td>2034.006</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2078.684</td>\n",
       "      <td>2083.136</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SH</td>\n",
       "      <td>20140106</td>\n",
       "      <td>交易</td>\n",
       "      <td>7.289539e+10</td>\n",
       "      <td>8.958761e+09</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2047.317</td>\n",
       "      <td>000001</td>\n",
       "      <td>1d</td>\n",
       "      <td>2052.279</td>\n",
       "      <td>2029.246</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2034.224</td>\n",
       "      <td>2045.709</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SH</td>\n",
       "      <td>20140107</td>\n",
       "      <td>交易</td>\n",
       "      <td>5.463864e+10</td>\n",
       "      <td>6.340294e+09</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2044.340</td>\n",
       "      <td>000001</td>\n",
       "      <td>1d</td>\n",
       "      <td>2062.952</td>\n",
       "      <td>2037.110</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2047.256</td>\n",
       "      <td>2047.317</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SH</td>\n",
       "      <td>20140108</td>\n",
       "      <td>交易</td>\n",
       "      <td>6.294143e+10</td>\n",
       "      <td>7.164736e+09</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      close    code freq      high       low  oi      open  preclose  \\\n",
       "0  2109.387  000001   1d  2113.110  2101.016 NaN  2112.126  2115.978   \n",
       "1  2083.136  000001   1d  2102.167  2075.899 NaN  2101.542  2109.387   \n",
       "2  2045.709  000001   1d  2078.684  2034.006 NaN  2078.684  2083.136   \n",
       "3  2047.317  000001   1d  2052.279  2029.246 NaN  2034.224  2045.709   \n",
       "4  2044.340  000001   1d  2062.952  2037.110 NaN  2047.256  2047.317   \n",
       "\n",
       "   presettle  settle     symbol  trade_date trade_status      turnover  \\\n",
       "0        NaN     NaN  000001.SH    20140102           交易  6.192135e+10   \n",
       "1        NaN     NaN  000001.SH    20140103           交易  7.237223e+10   \n",
       "2        NaN     NaN  000001.SH    20140106           交易  7.289539e+10   \n",
       "3        NaN     NaN  000001.SH    20140107           交易  5.463864e+10   \n",
       "4        NaN     NaN  000001.SH    20140108           交易  6.294143e+10   \n",
       "\n",
       "         volume  vwap  \n",
       "0  6.848549e+09   0.0  \n",
       "1  8.449724e+09   0.0  \n",
       "2  8.958761e+09   0.0  \n",
       "3  6.340294e+09   0.0  \n",
       "4  7.164736e+09   0.0  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df,msg = ds.daily(\"000001.SH\",start_date=\"2014-01-01\",end_date=20150101, adjust_mode=\"post\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## bar\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.bar(*args, **kwargs) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取分钟线行情（不含ask，bid信息）\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SH,600300.SH'|\n",
    "|start_time |否 |int (HHMMSS) or str ('HH:MM:SS') |开始时间 默认开盘时间按|\n",
    "|end_time |否 int (HHMMSS) or str ('HH:MM:SS') |结束时间 默认收盘时间|\n",
    "|trade_date|是 | int (YYYMMDD) or str ('YYYY-MM-DD') |交易日|\n",
    "|fields |否 | str |字段 以 ','隔开, 默认 \"\" (包含所有字段)|\n",
    "|freq |否 | str（'1M', '5M', '15M'） |分钟bar类型，默认1M(1分钟)|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "   \n",
    "   columns:\n",
    "        \n",
    "        symbol, code, date, time, trade_date, freq, open, high, low, close, volume, turnover, vwap, oi\n",
    "        \n",
    "   具体字段含义见quote()方法-返回字段说明\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n",
    "    \n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>code</th>\n",
       "      <th>date</th>\n",
       "      <th>freq</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>oi</th>\n",
       "      <th>open</th>\n",
       "      <th>settle</th>\n",
       "      <th>symbol</th>\n",
       "      <th>time</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>turnover</th>\n",
       "      <th>volume</th>\n",
       "      <th>vwap</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10.86</td>\n",
       "      <td>000001</td>\n",
       "      <td>20180328</td>\n",
       "      <td>1M</td>\n",
       "      <td>10.86</td>\n",
       "      <td>10.84</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.85</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93100</td>\n",
       "      <td>20180328</td>\n",
       "      <td>17128195.0</td>\n",
       "      <td>1579138.0</td>\n",
       "      <td>10.846547</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10.89</td>\n",
       "      <td>000001</td>\n",
       "      <td>20180328</td>\n",
       "      <td>1M</td>\n",
       "      <td>10.89</td>\n",
       "      <td>10.86</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.86</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93200</td>\n",
       "      <td>20180328</td>\n",
       "      <td>10527285.0</td>\n",
       "      <td>968044.0</td>\n",
       "      <td>10.874800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>10.88</td>\n",
       "      <td>000001</td>\n",
       "      <td>20180328</td>\n",
       "      <td>1M</td>\n",
       "      <td>10.89</td>\n",
       "      <td>10.87</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.88</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93300</td>\n",
       "      <td>20180328</td>\n",
       "      <td>9965762.0</td>\n",
       "      <td>916456.0</td>\n",
       "      <td>10.874239</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>10.86</td>\n",
       "      <td>000001</td>\n",
       "      <td>20180328</td>\n",
       "      <td>1M</td>\n",
       "      <td>10.89</td>\n",
       "      <td>10.86</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.87</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93400</td>\n",
       "      <td>20180328</td>\n",
       "      <td>7912778.0</td>\n",
       "      <td>728400.0</td>\n",
       "      <td>10.863232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>10.86</td>\n",
       "      <td>000001</td>\n",
       "      <td>20180328</td>\n",
       "      <td>1M</td>\n",
       "      <td>10.87</td>\n",
       "      <td>10.86</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.86</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93500</td>\n",
       "      <td>20180328</td>\n",
       "      <td>3930566.0</td>\n",
       "      <td>361800.0</td>\n",
       "      <td>10.863919</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   close    code      date freq   high    low  oi   open  settle     symbol  \\\n",
       "0  10.86  000001  20180328   1M  10.86  10.84 NaN  10.85     NaN  000001.SZ   \n",
       "1  10.89  000001  20180328   1M  10.89  10.86 NaN  10.86     NaN  000001.SZ   \n",
       "2  10.88  000001  20180328   1M  10.89  10.87 NaN  10.88     NaN  000001.SZ   \n",
       "3  10.86  000001  20180328   1M  10.89  10.86 NaN  10.87     NaN  000001.SZ   \n",
       "4  10.86  000001  20180328   1M  10.87  10.86 NaN  10.86     NaN  000001.SZ   \n",
       "\n",
       "    time  trade_date    turnover     volume       vwap  \n",
       "0  93100    20180328  17128195.0  1579138.0  10.846547  \n",
       "1  93200    20180328  10527285.0   968044.0  10.874800  \n",
       "2  93300    20180328   9965762.0   916456.0  10.874239  \n",
       "3  93400    20180328   7912778.0   728400.0  10.863232  \n",
       "4  93500    20180328   3930566.0   361800.0  10.863919  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df,msg = ds.bar(\"000001.SZ,000002.SZ\", trade_date =20180328,  freq=\"1M\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## quote\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.quote(symbol, fields=\"\") `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 查询最新市场行情\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SH,600300.SH'|\n",
    "|fields |否 | str |需要返回字段，多字段以','隔开；为\"\"时返回所有字段|\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n",
    "    \n",
    "** 返回字段说明：**\n",
    "\n",
    "|字段|类型|说明|\n",
    "|:----    |:---|----- |\n",
    "|symbol\t|string\t|标的代码|\n",
    "|code|tring\t|交易所原始代码|\n",
    "|date\t|int\t|自然日,YYYYMMDD格式，如20170823|\n",
    "|time\t|int\t|时间，精确到毫秒，如14:21:05.330记为142105330|\n",
    "|trade_date|\tint|\tYYYYMMDD格式，如20170823|\n",
    "|open\t|double\t|开盘价|\n",
    "|high\t|double|\t最高价|\n",
    "|low\t|double|\t最低价|\n",
    "|last\t|double|\t最新价|\n",
    "|close\t|double\t|收盘价|\n",
    "|volume|\tdouble\t|成交量（总）|\n",
    "|turnover\t|double|\t成交金额（总）|\n",
    "|vwap\t|double\t|截止到行情时间的日内成交均价|\n",
    "|oi\t|double\t|持仓总量|\n",
    "|settle\t|double\t|今结算价|\n",
    "|iopv\t|double|\t净值估值|\n",
    "|limit_up\t|double|\t涨停价|\n",
    "|limit_down|\tdouble|\t跌停价|\n",
    "|preclose\t|double\t|昨收盘价|\n",
    "|presettle\t|double\t|昨结算价|\n",
    "|preoi\t|double\t|昨持仓|\n",
    "|askprice1\t|double|\t申卖价1|\n",
    "|askprice2\t|double|\t申卖价2|\n",
    "|askprice3\t|double\t|申卖价3|\n",
    "|askprice4\t|double|\t申卖价4|\n",
    "|askprice5\t|double\t|申卖价5|\n",
    "|bidprice1\t|double\t|申买价1|\n",
    "|bidprice2\t|double\t|申买价2|\n",
    "|bidprice3\t|double\t|申买价3|\n",
    "|bidprice4\t|double|\t申买价4|\n",
    "|bidprice5\t|double\t|申买价5|\n",
    "|askvolume1\t|double\t|申卖量1|\n",
    "|askvolume2\t|double\t|申卖量2|\n",
    "|askvolume3|\tdouble\t|申卖量3|\n",
    "|askvolume4\t|double\t|申卖量4|\n",
    "|askvolume5\t|double\t|申卖量5|\n",
    "|bidvolume1|double\t|申买量1|\n",
    "|bidvolume2|\tdouble|\t申买量2|\n",
    "|bidvolume3|\tdouble|\t申买量3|\n",
    "|bidvolume4|\tdouble|\t申买量4|\n",
    "|bidvolume5|\tdouble|\t申买量5|\n",
    "    \n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ask1_premium</th>\n",
       "      <th>askprice1</th>\n",
       "      <th>askprice10</th>\n",
       "      <th>askprice2</th>\n",
       "      <th>askprice3</th>\n",
       "      <th>askprice4</th>\n",
       "      <th>askprice5</th>\n",
       "      <th>askprice6</th>\n",
       "      <th>askprice7</th>\n",
       "      <th>askprice8</th>\n",
       "      <th>...</th>\n",
       "      <th>preclose</th>\n",
       "      <th>preoi</th>\n",
       "      <th>presettle</th>\n",
       "      <th>settle</th>\n",
       "      <th>symbol</th>\n",
       "      <th>time</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>turnover</th>\n",
       "      <th>volume</th>\n",
       "      <th>vwap</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>000001.SZ</th>\n",
       "      <td>NaN</td>\n",
       "      <td>8.74</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.75</td>\n",
       "      <td>8.76</td>\n",
       "      <td>8.77</td>\n",
       "      <td>8.78</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>8.88</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>150003000</td>\n",
       "      <td>20180716</td>\n",
       "      <td>6.034277e+08</td>\n",
       "      <td>68984558</td>\n",
       "      <td>8.747287</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000002.SZ</th>\n",
       "      <td>NaN</td>\n",
       "      <td>23.15</td>\n",
       "      <td>0.0</td>\n",
       "      <td>23.16</td>\n",
       "      <td>23.17</td>\n",
       "      <td>23.18</td>\n",
       "      <td>23.19</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>23.72</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>000002.SZ</td>\n",
       "      <td>150003000</td>\n",
       "      <td>20180716</td>\n",
       "      <td>9.947463e+08</td>\n",
       "      <td>43069406</td>\n",
       "      <td>23.096355</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2 rows × 62 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "           ask1_premium  askprice1  askprice10  askprice2  askprice3  \\\n",
       "000001.SZ           NaN       8.74         0.0       8.75       8.76   \n",
       "000002.SZ           NaN      23.15         0.0      23.16      23.17   \n",
       "\n",
       "           askprice4  askprice5  askprice6  askprice7  askprice8    ...      \\\n",
       "000001.SZ       8.77       8.78        0.0        0.0        0.0    ...       \n",
       "000002.SZ      23.18      23.19        0.0        0.0        0.0    ...       \n",
       "\n",
       "           preclose  preoi  presettle  settle     symbol       time  \\\n",
       "000001.SZ      8.88      0        0.0     0.0  000001.SZ  150003000   \n",
       "000002.SZ     23.72      0        0.0     0.0  000002.SZ  150003000   \n",
       "\n",
       "           trade_date      turnover    volume       vwap  \n",
       "000001.SZ    20180716  6.034277e+08  68984558   8.747287  \n",
       "000002.SZ    20180716  9.947463e+08  43069406  23.096355  \n",
       "\n",
       "[2 rows x 62 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df,msg = ds.quote(\"000001.SZ,000002.SZ\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## bar_quote\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.bar_quote(*args, **kwargs) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取分钟线行情（含最近的quote信息）\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SH,600300.SH'|\n",
    "|start_time |否 |int (HHMMSS) or str ('HH:MM:SS') |开始时间 默认开盘时间按|\n",
    "|end_time |否 int (HHMMSS) or str ('HH:MM:SS') |结束时间 默认收盘时间|\n",
    "|trade_date|是 | int (YYYMMDD) or str ('YYYY-MM-DD') |交易日|\n",
    "|fields |否 | str |字段 以 ','隔开, 默认 \"\" (包含所有字段)|\n",
    "|freq |否 | str（'1M', '5M', '15M'） |分钟bar类型，默认1M(1分钟)|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "    \n",
    "    具体字段含义见quote()方法-返回字段说明\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n",
    "    \n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>askprice1</th>\n",
       "      <th>askprice2</th>\n",
       "      <th>askprice3</th>\n",
       "      <th>askprice4</th>\n",
       "      <th>askprice5</th>\n",
       "      <th>askvolume1</th>\n",
       "      <th>askvolume2</th>\n",
       "      <th>askvolume3</th>\n",
       "      <th>askvolume4</th>\n",
       "      <th>askvolume5</th>\n",
       "      <th>...</th>\n",
       "      <th>open</th>\n",
       "      <th>sell_cancel_volume</th>\n",
       "      <th>sell_volume</th>\n",
       "      <th>settle</th>\n",
       "      <th>symbol</th>\n",
       "      <th>time</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>turnover</th>\n",
       "      <th>volume</th>\n",
       "      <th>vwap</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10.87</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.89</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.91</td>\n",
       "      <td>64900.0</td>\n",
       "      <td>259144.0</td>\n",
       "      <td>14800.0</td>\n",
       "      <td>47100.0</td>\n",
       "      <td>2400.0</td>\n",
       "      <td>...</td>\n",
       "      <td>10.85</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93100</td>\n",
       "      <td>20180328</td>\n",
       "      <td>17128195.0</td>\n",
       "      <td>1579138.0</td>\n",
       "      <td>10.846547</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10.90</td>\n",
       "      <td>10.91</td>\n",
       "      <td>10.92</td>\n",
       "      <td>10.93</td>\n",
       "      <td>10.94</td>\n",
       "      <td>58900.0</td>\n",
       "      <td>16800.0</td>\n",
       "      <td>194100.0</td>\n",
       "      <td>10020.0</td>\n",
       "      <td>80600.0</td>\n",
       "      <td>...</td>\n",
       "      <td>10.86</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93200</td>\n",
       "      <td>20180328</td>\n",
       "      <td>10527285.0</td>\n",
       "      <td>968044.0</td>\n",
       "      <td>10.874800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>10.88</td>\n",
       "      <td>10.89</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.91</td>\n",
       "      <td>10.92</td>\n",
       "      <td>13300.0</td>\n",
       "      <td>46374.0</td>\n",
       "      <td>70500.0</td>\n",
       "      <td>134600.0</td>\n",
       "      <td>195200.0</td>\n",
       "      <td>...</td>\n",
       "      <td>10.88</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93300</td>\n",
       "      <td>20180328</td>\n",
       "      <td>9965762.0</td>\n",
       "      <td>916456.0</td>\n",
       "      <td>10.874239</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>10.86</td>\n",
       "      <td>10.87</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.89</td>\n",
       "      <td>10.90</td>\n",
       "      <td>27600.0</td>\n",
       "      <td>24200.0</td>\n",
       "      <td>211300.0</td>\n",
       "      <td>86074.0</td>\n",
       "      <td>95500.0</td>\n",
       "      <td>...</td>\n",
       "      <td>10.87</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93400</td>\n",
       "      <td>20180328</td>\n",
       "      <td>7912778.0</td>\n",
       "      <td>728400.0</td>\n",
       "      <td>10.863232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>10.87</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.89</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.91</td>\n",
       "      <td>140600.0</td>\n",
       "      <td>167900.0</td>\n",
       "      <td>85974.0</td>\n",
       "      <td>83300.0</td>\n",
       "      <td>128700.0</td>\n",
       "      <td>...</td>\n",
       "      <td>10.86</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>93500</td>\n",
       "      <td>20180328</td>\n",
       "      <td>3930566.0</td>\n",
       "      <td>361800.0</td>\n",
       "      <td>10.863919</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 39 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   askprice1  askprice2  askprice3  askprice4  askprice5  askvolume1  \\\n",
       "0      10.87      10.88      10.89      10.90      10.91     64900.0   \n",
       "1      10.90      10.91      10.92      10.93      10.94     58900.0   \n",
       "2      10.88      10.89      10.90      10.91      10.92     13300.0   \n",
       "3      10.86      10.87      10.88      10.89      10.90     27600.0   \n",
       "4      10.87      10.88      10.89      10.90      10.91    140600.0   \n",
       "\n",
       "   askvolume2  askvolume3  askvolume4  askvolume5    ...       open  \\\n",
       "0    259144.0     14800.0     47100.0      2400.0    ...      10.85   \n",
       "1     16800.0    194100.0     10020.0     80600.0    ...      10.86   \n",
       "2     46374.0     70500.0    134600.0    195200.0    ...      10.88   \n",
       "3     24200.0    211300.0     86074.0     95500.0    ...      10.87   \n",
       "4    167900.0     85974.0     83300.0    128700.0    ...      10.86   \n",
       "\n",
       "   sell_cancel_volume  sell_volume  settle     symbol   time  trade_date  \\\n",
       "0                 0.0          0.0     NaN  000001.SZ  93100    20180328   \n",
       "1                 0.0          0.0     NaN  000001.SZ  93200    20180328   \n",
       "2                 0.0          0.0     NaN  000001.SZ  93300    20180328   \n",
       "3                 0.0          0.0     NaN  000001.SZ  93400    20180328   \n",
       "4                 0.0          0.0     NaN  000001.SZ  93500    20180328   \n",
       "\n",
       "     turnover     volume       vwap  \n",
       "0  17128195.0  1579138.0  10.846547  \n",
       "1  10527285.0   968044.0  10.874800  \n",
       "2   9965762.0   916456.0  10.874239  \n",
       "3   7912778.0   728400.0  10.863232  \n",
       "4   3930566.0   361800.0  10.863919  \n",
       "\n",
       "[5 rows x 39 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df,msg = ds.bar_quote(\"000001.SZ,000002.SZ\", trade_date =20180328,  freq=\"1M\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query(view, filter=\"\", fields=\"\", **kwargs) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取各种参考数据，直接继承自底层dataapi.query \n",
    "- 使用方法详见[基础数据获取方法](http://jaqs.readthedocs.io/zh_CN/latest/user_guide.html#id10)\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|view|是 |string|参考数据的api名称,如\"jz.instrumentInfo\"(证券基础信息),\"help.apiList\"(帮助列表)|\n",
    "|filter|否 |string|过滤条件。过滤条件支持两种写法：1)以某个关键字的值作为条件来查询：\"[字段值]=[某个值]\"。多个值以\"，\"隔开。 2)按关键字范围来查询：\"start[字段值]=[某个值]&end[字段值]=[某个值]\"。多个条件以\"&\"作为分隔符。例如：filter=\"symbol=600030.SH,000063.SZ,000001.SZ&report_type=408002000&start_date=20160601&end_date=20170601\"|\n",
    "|fields |否 | str |要查询的字段 以 ','隔开, 默认 \"\"|\n",
    "\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n",
    "    \n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 查询帮助文档\n",
    "\n",
    "- 目前，可查询到的帮助文档并不完整，如\"lb.profitExpress\"（业绩快报）,\"lb.secRestricted\"(限售股解禁表)等api无法查询字段细节。文档还在不断完善中。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>api</th>\n",
       "      <th>comment</th>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>jy.balanceSheet</td>\n",
       "      <td>资产负债表</td>\n",
       "      <td>资产负债表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>jy.cashFlow</td>\n",
       "      <td>现金流量表</td>\n",
       "      <td>现金流量表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>jy.income</td>\n",
       "      <td>利润表</td>\n",
       "      <td>利润表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>jy.qincome</td>\n",
       "      <td>季度利润表</td>\n",
       "      <td>季度利润表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>jz.instrumentInfo</td>\n",
       "      <td>证券基本信息</td>\n",
       "      <td>证券基础信息</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>jz.secTradeCal</td>\n",
       "      <td>交易日历</td>\n",
       "      <td>交易日历</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>lb.balanceSheet</td>\n",
       "      <td>资产负债表</td>\n",
       "      <td>资产负债表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>lb.cashFlow</td>\n",
       "      <td>现金流量表</td>\n",
       "      <td>现金流量表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>lb.dcCoinInfo</td>\n",
       "      <td>数字货币信息</td>\n",
       "      <td>数字货币信息</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>lb.dcDaily</td>\n",
       "      <td>数字货币日行情</td>\n",
       "      <td>数字货币日行情</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>lb.dcExchangeInfo</td>\n",
       "      <td>十大数字货币交易所信息</td>\n",
       "      <td>数字货币交易所信息</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>lb.dcTradeInfo</td>\n",
       "      <td>数字货币交易标的信息</td>\n",
       "      <td>数字货币交易标的信息</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>lb.hkSecDailyIndicator</td>\n",
       "      <td>港股日行情指标</td>\n",
       "      <td>港股日行情指标</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>lb.income</td>\n",
       "      <td>利润表</td>\n",
       "      <td>利润表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>lb.indexCons</td>\n",
       "      <td>指数成份股</td>\n",
       "      <td>指数成份股</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>lb.indexInfo</td>\n",
       "      <td>指数基本信息</td>\n",
       "      <td>指数基本信息</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>lb.industryType</td>\n",
       "      <td>行业代码表</td>\n",
       "      <td>行业代码表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>lb.mfDailyPerform</td>\n",
       "      <td>公募基金行情表现</td>\n",
       "      <td>公募基金行情表现</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>lb.mfNav</td>\n",
       "      <td>公募基金净值</td>\n",
       "      <td>公募基金净值</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>lb.secAdjFactor</td>\n",
       "      <td>复权因子</td>\n",
       "      <td>复权因子</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>lb.secArchives</td>\n",
       "      <td>公司概况</td>\n",
       "      <td>公司概况</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td>股票每日指标</td>\n",
       "      <td>股票每日指标</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>lb.secDailyPerform</td>\n",
       "      <td>股票行情表现</td>\n",
       "      <td>股票行情表现</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>lb.secDividend</td>\n",
       "      <td>分红送股</td>\n",
       "      <td>分红送股表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>lb.secFinIndicators</td>\n",
       "      <td>财务数据指标</td>\n",
       "      <td>财务数据指标</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>lb.secFrozenPledger</td>\n",
       "      <td>股东股权冻结和质押</td>\n",
       "      <td>股东股权冻结和质押</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>lb.secHolderNumber</td>\n",
       "      <td>股东户数</td>\n",
       "      <td>股东户数</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>lb.secHoldingStats</td>\n",
       "      <td>股东持股统计</td>\n",
       "      <td>股东持股统计</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>lb.secIEXDaily</td>\n",
       "      <td>美股公司日行情</td>\n",
       "      <td>美股公司日行情</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>lb.secIEXEps</td>\n",
       "      <td>美股公司每股收益指标</td>\n",
       "      <td>美股公司每股收益指标</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>lb.secIEXFinIndex</td>\n",
       "      <td>美股公司财务报表指标</td>\n",
       "      <td>美股公司财务报表指标</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>lb.secIEXSymbol</td>\n",
       "      <td>美股公司股票列表</td>\n",
       "      <td>美股公司股票列表</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>lb.secIndustry</td>\n",
       "      <td>行业分类信息</td>\n",
       "      <td>行业分类</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>lb.secMainHolders</td>\n",
       "      <td>股东名单</td>\n",
       "      <td>股东名单</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>lb.secNewestFinIndex</td>\n",
       "      <td>A股公司最新财务指标</td>\n",
       "      <td>A股公司最新财务指标</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>lb.secNewestShareStru</td>\n",
       "      <td>最新公司股本结构</td>\n",
       "      <td>最新公司股本结构</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>lb.secSusp</td>\n",
       "      <td>停复牌数据</td>\n",
       "      <td>停复牌</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       api      comment        name\n",
       "0          jy.balanceSheet        资产负债表       资产负债表\n",
       "1              jy.cashFlow        现金流量表       现金流量表\n",
       "2                jy.income          利润表         利润表\n",
       "3               jy.qincome        季度利润表       季度利润表\n",
       "4        jz.instrumentInfo       证券基本信息      证券基础信息\n",
       "5           jz.secTradeCal         交易日历        交易日历\n",
       "6          lb.balanceSheet        资产负债表       资产负债表\n",
       "7              lb.cashFlow        现金流量表       现金流量表\n",
       "8            lb.dcCoinInfo       数字货币信息      数字货币信息\n",
       "9               lb.dcDaily      数字货币日行情     数字货币日行情\n",
       "10       lb.dcExchangeInfo  十大数字货币交易所信息   数字货币交易所信息\n",
       "11          lb.dcTradeInfo   数字货币交易标的信息  数字货币交易标的信息\n",
       "12  lb.hkSecDailyIndicator      港股日行情指标     港股日行情指标\n",
       "13               lb.income          利润表         利润表\n",
       "14            lb.indexCons        指数成份股       指数成份股\n",
       "15            lb.indexInfo       指数基本信息      指数基本信息\n",
       "16         lb.industryType        行业代码表       行业代码表\n",
       "17       lb.mfDailyPerform     公募基金行情表现    公募基金行情表现\n",
       "18                lb.mfNav       公募基金净值      公募基金净值\n",
       "19         lb.secAdjFactor         复权因子        复权因子\n",
       "20          lb.secArchives         公司概况        公司概况\n",
       "21    lb.secDailyIndicator       股票每日指标      股票每日指标\n",
       "22      lb.secDailyPerform       股票行情表现      股票行情表现\n",
       "23          lb.secDividend         分红送股       分红送股表\n",
       "24     lb.secFinIndicators       财务数据指标      财务数据指标\n",
       "25     lb.secFrozenPledger    股东股权冻结和质押   股东股权冻结和质押\n",
       "26      lb.secHolderNumber         股东户数        股东户数\n",
       "27      lb.secHoldingStats       股东持股统计      股东持股统计\n",
       "28          lb.secIEXDaily      美股公司日行情     美股公司日行情\n",
       "29            lb.secIEXEps   美股公司每股收益指标  美股公司每股收益指标\n",
       "30       lb.secIEXFinIndex   美股公司财务报表指标  美股公司财务报表指标\n",
       "31         lb.secIEXSymbol     美股公司股票列表    美股公司股票列表\n",
       "32          lb.secIndustry       行业分类信息        行业分类\n",
       "33       lb.secMainHolders         股东名单        股东名单\n",
       "34    lb.secNewestFinIndex   A股公司最新财务指标  A股公司最新财务指标\n",
       "35   lb.secNewestShareStru     最新公司股本结构    最新公司股本结构\n",
       "36              lb.secSusp        停复牌数据         停复牌"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df , msg = ds.query(\n",
    "              view=\"help.apiList\",\n",
    "              fields=\"\",\n",
    "              filter=\"\")\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 查询帮助文档细节-可选字段"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>api</th>\n",
       "      <th>comment</th>\n",
       "      <th>dtype</th>\n",
       "      <th>must</th>\n",
       "      <th>param</th>\n",
       "      <th>pname</th>\n",
       "      <th>ptype</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>118</th>\n",
       "      <td>lb.cashFlow</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>tot_bal_netcash_inc</td>\n",
       "      <td>现金净增加额差额(合计平衡项目)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>119</th>\n",
       "      <td>lb.cashFlow</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>spe_bal_netcash_equ_undir</td>\n",
       "      <td>间接法-经营活动现金流量净额差额(特殊报表科目)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>120</th>\n",
       "      <td>lb.cashFlow</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>tot_bal_netcash_equ_undir</td>\n",
       "      <td>间接法-经营活动现金流量净额差额(合计平衡项目)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>lb.cashFlow</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>spe_bal_netcash_inc_undir</td>\n",
       "      <td>间接法-现金净增加额差额(特殊报表科目)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>122</th>\n",
       "      <td>lb.cashFlow</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>tot_bal_netcash_inc_undir</td>\n",
       "      <td>间接法-现金净增加额差额(合计平衡项目)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             api comment   dtype must                      param  \\\n",
       "118  lb.cashFlow          Double    N        tot_bal_netcash_inc   \n",
       "119  lb.cashFlow          Double    N  spe_bal_netcash_equ_undir   \n",
       "120  lb.cashFlow          Double    N  tot_bal_netcash_equ_undir   \n",
       "121  lb.cashFlow          Double    N  spe_bal_netcash_inc_undir   \n",
       "122  lb.cashFlow          Double    N  tot_bal_netcash_inc_undir   \n",
       "\n",
       "                        pname ptype  \n",
       "118          现金净增加额差额(合计平衡项目)   OUT  \n",
       "119  间接法-经营活动现金流量净额差额(特殊报表科目)   OUT  \n",
       "120  间接法-经营活动现金流量净额差额(合计平衡项目)   OUT  \n",
       "121      间接法-现金净增加额差额(特殊报表科目)   OUT  \n",
       "122      间接法-现金净增加额差额(合计平衡项目)   OUT  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df ,msg = ds.query(view=\"help.apiParam\",fields=\"\",filter=\"api=lb.cashFlow\") # 查询现金流量表可选字段\n",
    "df.tail()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 根据帮助文档细节-可选字段查询具体内容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ann_date</th>\n",
       "      <th>cash_recp_prem_orig_inco</th>\n",
       "      <th>cash_recp_return_invest</th>\n",
       "      <th>cash_recp_sg_and_rs</th>\n",
       "      <th>fa_fnc_leases</th>\n",
       "      <th>incl_dvd_profit_paid_sc_ms</th>\n",
       "      <th>net_cash_flows_inv_act</th>\n",
       "      <th>net_cash_received_reinsu_bus</th>\n",
       "      <th>net_incr_dep_cob</th>\n",
       "      <th>net_incr_disp_tfa</th>\n",
       "      <th>...</th>\n",
       "      <th>net_incr_int_handling_chrg</th>\n",
       "      <th>net_incr_loans_central_bank</th>\n",
       "      <th>other_cash_recp_ral_fnc_act</th>\n",
       "      <th>other_cash_recp_ral_oper_act</th>\n",
       "      <th>recp_tax_rends</th>\n",
       "      <th>report_date</th>\n",
       "      <th>report_type</th>\n",
       "      <th>stot_cash_inflows_oper_act</th>\n",
       "      <th>stot_cash_outflows_oper_act</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20160812</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.851000e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-2.912000e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.130000e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>3.345900e+10</td>\n",
       "      <td>3.802800e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.553000e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20160630</td>\n",
       "      <td>408002000</td>\n",
       "      <td>7.374400e+10</td>\n",
       "      <td>1.662100e+11</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20161021</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7.687000e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>2.673900e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.108000e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>3.308600e+10</td>\n",
       "      <td>-3.047500e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.779000e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20160930</td>\n",
       "      <td>408002000</td>\n",
       "      <td>1.936900e+10</td>\n",
       "      <td>1.391130e+11</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20170317</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6.222000e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-5.181000e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.542100e+11</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>3.085400e+10</td>\n",
       "      <td>7.585000e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.116000e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20161231</td>\n",
       "      <td>408002000</td>\n",
       "      <td>2.514760e+11</td>\n",
       "      <td>8.754500e+10</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20170422</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.120000e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-4.720900e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>3.559700e+10</td>\n",
       "      <td>5.922000e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.366700e+10</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20170331</td>\n",
       "      <td>408002000</td>\n",
       "      <td>4.716300e+10</td>\n",
       "      <td>1.621710e+11</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20160826</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-3.896400e+07</td>\n",
       "      <td>2.982796e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.561300e+07</td>\n",
       "      <td>-5.184770e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.246570e+08</td>\n",
       "      <td>3.181431e+09</td>\n",
       "      <td>20160630</td>\n",
       "      <td>408002000</td>\n",
       "      <td>3.383405e+10</td>\n",
       "      <td>3.542464e+10</td>\n",
       "      <td>000063.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20161028</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.991480e+08</td>\n",
       "      <td>2.535173e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-1.684021e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8.164560e+08</td>\n",
       "      <td>1.353395e+09</td>\n",
       "      <td>20160930</td>\n",
       "      <td>408002000</td>\n",
       "      <td>2.752158e+10</td>\n",
       "      <td>2.865721e+10</td>\n",
       "      <td>000063.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>20170324</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.755800e+07</td>\n",
       "      <td>2.688080e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>-4.290710e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.089501e+09</td>\n",
       "      <td>1.504245e+09</td>\n",
       "      <td>20161231</td>\n",
       "      <td>408002000</td>\n",
       "      <td>2.947455e+10</td>\n",
       "      <td>2.543364e+10</td>\n",
       "      <td>000063.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>20170418</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.748800e+07</td>\n",
       "      <td>2.693577e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.733100e+07</td>\n",
       "      <td>-8.994460e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.601030e+08</td>\n",
       "      <td>1.424996e+09</td>\n",
       "      <td>20170331</td>\n",
       "      <td>408002000</td>\n",
       "      <td>2.882086e+10</td>\n",
       "      <td>2.979203e+10</td>\n",
       "      <td>000063.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>20160825</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.003506e+07</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.256104e+08</td>\n",
       "      <td>9.026859e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>8.989932e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.972198e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20160630</td>\n",
       "      <td>408002000</td>\n",
       "      <td>6.358746e+10</td>\n",
       "      <td>9.064982e+10</td>\n",
       "      <td>600030.SH</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>20161029</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.193007e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.561776e+07</td>\n",
       "      <td>9.370361e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>8.457742e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.074041e+10</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20160930</td>\n",
       "      <td>408002000</td>\n",
       "      <td>-3.589391e+10</td>\n",
       "      <td>-2.131723e+10</td>\n",
       "      <td>600030.SH</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>20170323</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.809526e+08</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-9.404244e+06</td>\n",
       "      <td>3.555107e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.023140e+10</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-5.922571e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20161231</td>\n",
       "      <td>408002000</td>\n",
       "      <td>4.155698e+10</td>\n",
       "      <td>3.480941e+10</td>\n",
       "      <td>600030.SH</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>20170429</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.998582e+06</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>7.633333e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>8.510626e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.055551e+10</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>20170331</td>\n",
       "      <td>408002000</td>\n",
       "      <td>-7.895648e+09</td>\n",
       "      <td>3.004603e+10</td>\n",
       "      <td>600030.SH</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>12 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    ann_date  cash_recp_prem_orig_inco  cash_recp_return_invest  \\\n",
       "0   20160812                       0.0             6.851000e+09   \n",
       "1   20161021                       0.0             7.687000e+09   \n",
       "2   20170317                       0.0             6.222000e+09   \n",
       "3   20170422                       0.0             8.120000e+09   \n",
       "4   20160826                       0.0            -3.896400e+07   \n",
       "5   20161028                       0.0             5.991480e+08   \n",
       "6   20170324                       0.0             3.755800e+07   \n",
       "7   20170418                       0.0             3.748800e+07   \n",
       "8   20160825                       0.0             1.003506e+07   \n",
       "9   20161029                       0.0             2.193007e+06   \n",
       "10  20170323                       0.0             1.809526e+08   \n",
       "11  20170429                       0.0             1.998582e+06   \n",
       "\n",
       "    cash_recp_sg_and_rs  fa_fnc_leases  incl_dvd_profit_paid_sc_ms  \\\n",
       "0          0.000000e+00            0.0                0.000000e+00   \n",
       "1          0.000000e+00            0.0                0.000000e+00   \n",
       "2          0.000000e+00            0.0                0.000000e+00   \n",
       "3          0.000000e+00            0.0                0.000000e+00   \n",
       "4          2.982796e+10            0.0                2.561300e+07   \n",
       "5          2.535173e+10            0.0                0.000000e+00   \n",
       "6          2.688080e+10            0.0                0.000000e+00   \n",
       "7          2.693577e+10            0.0                5.733100e+07   \n",
       "8          0.000000e+00            0.0                1.256104e+08   \n",
       "9          0.000000e+00            0.0                4.561776e+07   \n",
       "10         0.000000e+00            0.0               -9.404244e+06   \n",
       "11         0.000000e+00            0.0                0.000000e+00   \n",
       "\n",
       "    net_cash_flows_inv_act  net_cash_received_reinsu_bus  net_incr_dep_cob  \\\n",
       "0            -2.912000e+10                           0.0      3.130000e+09   \n",
       "1             2.673900e+10                           0.0      2.108000e+09   \n",
       "2            -5.181000e+09                           0.0      1.542100e+11   \n",
       "3            -4.720900e+10                           0.0      0.000000e+00   \n",
       "4            -5.184770e+08                           0.0      0.000000e+00   \n",
       "5            -1.684021e+09                           0.0      0.000000e+00   \n",
       "6            -4.290710e+08                           0.0      0.000000e+00   \n",
       "7            -8.994460e+08                           0.0      0.000000e+00   \n",
       "8             9.026859e+09                           0.0      0.000000e+00   \n",
       "9             9.370361e+09                           0.0      0.000000e+00   \n",
       "10            3.555107e+09                           0.0      0.000000e+00   \n",
       "11            7.633333e+09                           0.0      0.000000e+00   \n",
       "\n",
       "    net_incr_disp_tfa    ...      net_incr_int_handling_chrg  \\\n",
       "0                 0.0    ...                    3.345900e+10   \n",
       "1                 0.0    ...                    3.308600e+10   \n",
       "2                 0.0    ...                    3.085400e+10   \n",
       "3                 0.0    ...                    3.559700e+10   \n",
       "4                 0.0    ...                    0.000000e+00   \n",
       "5                 0.0    ...                    0.000000e+00   \n",
       "6                 0.0    ...                    0.000000e+00   \n",
       "7                 0.0    ...                    0.000000e+00   \n",
       "8                 0.0    ...                    8.989932e+09   \n",
       "9                 0.0    ...                    8.457742e+09   \n",
       "10                0.0    ...                    1.023140e+10   \n",
       "11                0.0    ...                    8.510626e+09   \n",
       "\n",
       "    net_incr_loans_central_bank  other_cash_recp_ral_fnc_act  \\\n",
       "0                  3.802800e+10                          0.0   \n",
       "1                 -3.047500e+10                          0.0   \n",
       "2                  7.585000e+09                          0.0   \n",
       "3                  5.922000e+09                          0.0   \n",
       "4                  0.000000e+00                          0.0   \n",
       "5                  0.000000e+00                          0.0   \n",
       "6                  0.000000e+00                          0.0   \n",
       "7                  0.000000e+00                          0.0   \n",
       "8                  0.000000e+00                          0.0   \n",
       "9                  0.000000e+00                          0.0   \n",
       "10                 0.000000e+00                          0.0   \n",
       "11                 0.000000e+00                          0.0   \n",
       "\n",
       "    other_cash_recp_ral_oper_act  recp_tax_rends  report_date  report_type  \\\n",
       "0                   1.553000e+09    0.000000e+00     20160630    408002000   \n",
       "1                   5.779000e+09    0.000000e+00     20160930    408002000   \n",
       "2                  -1.116000e+09    0.000000e+00     20161231    408002000   \n",
       "3                   1.366700e+10    0.000000e+00     20170331    408002000   \n",
       "4                   8.246570e+08    3.181431e+09     20160630    408002000   \n",
       "5                   8.164560e+08    1.353395e+09     20160930    408002000   \n",
       "6                   1.089501e+09    1.504245e+09     20161231    408002000   \n",
       "7                   4.601030e+08    1.424996e+09     20170331    408002000   \n",
       "8                   1.972198e+09    0.000000e+00     20160630    408002000   \n",
       "9                   1.074041e+10    0.000000e+00     20160930    408002000   \n",
       "10                 -5.922571e+09    0.000000e+00     20161231    408002000   \n",
       "11                  1.055551e+10    0.000000e+00     20170331    408002000   \n",
       "\n",
       "   stot_cash_inflows_oper_act stot_cash_outflows_oper_act     symbol  \n",
       "0                7.374400e+10                1.662100e+11  000001.SZ  \n",
       "1                1.936900e+10                1.391130e+11  000001.SZ  \n",
       "2                2.514760e+11                8.754500e+10  000001.SZ  \n",
       "3                4.716300e+10                1.621710e+11  000001.SZ  \n",
       "4                3.383405e+10                3.542464e+10  000063.SZ  \n",
       "5                2.752158e+10                2.865721e+10  000063.SZ  \n",
       "6                2.947455e+10                2.543364e+10  000063.SZ  \n",
       "7                2.882086e+10                2.979203e+10  000063.SZ  \n",
       "8                6.358746e+10                9.064982e+10  600030.SH  \n",
       "9               -3.589391e+10               -2.131723e+10  600030.SH  \n",
       "10               4.155698e+10                3.480941e+10  600030.SH  \n",
       "11              -7.895648e+09                3.004603e+10  600030.SH  \n",
       "\n",
       "[12 rows x 22 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df, msg = ds.query(\n",
    "                view=\"lb.cashFlow\",\n",
    "                fields=\"fa_fnc_leases\",\n",
    "                filter=\"symbol=600030.SH,000063.SZ,000001.SZ&report_type=408002000&start_date=20160601&end_date=20170601\",\n",
    "                data_format='pandas')\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_lb_fin_stat\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_lb_fin_stat(*args, **kwargs) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取基本面财务数据\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|type_|是 |string|财务指标类型 'income', 'balance_sheet', 'cash_flow'，'fin_indicator'|\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SH,600300.SH'|\n",
    "|start_date |是 |int |开始时间 YYYMMDD|\n",
    "|end_date |是 |int |结束时间 YYYMMDD|\n",
    "|fields |否 | str |字段 以 ','隔开, 默认 \"\" |\n",
    "|drop_dup_cols |否 | list or tuple |是否删除重复的输入|\n",
    "|report_type |否 | string |财报类型。财报类型共有以下几类：'408001000':合并报表；'408002000':合并报表（单季度）；'408003000':合并报表（单季度调整）；'408004000':合并报表（调整）；'408005000':合并报表（更正前）；'408006000':母公司报表；'408007000':母公司报表（单季度）；'408008000':母公司报表（单季度调整）；'408009000':母公司报表（调整）；'408010000':母公司报表（更正前）。 默认为'408001000':合并报表|\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n",
    "    \n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ann_date</th>\n",
       "      <th>cash_recp_prem_orig_inco</th>\n",
       "      <th>cash_recp_return_invest</th>\n",
       "      <th>cash_recp_sg_and_rs</th>\n",
       "      <th>conv_corp_bonds_due_within_1y</th>\n",
       "      <th>incl_dvd_profit_paid_sc_ms</th>\n",
       "      <th>net_cash_flows_inv_act</th>\n",
       "      <th>net_cash_received_reinsu_bus</th>\n",
       "      <th>net_incr_dep_cob</th>\n",
       "      <th>net_incr_disp_tfa</th>\n",
       "      <th>...</th>\n",
       "      <th>net_incr_int_handling_chrg</th>\n",
       "      <th>net_incr_loans_central_bank</th>\n",
       "      <th>other_cash_recp_ral_fnc_act</th>\n",
       "      <th>other_cash_recp_ral_oper_act</th>\n",
       "      <th>recp_tax_rends</th>\n",
       "      <th>report_date</th>\n",
       "      <th>report_type</th>\n",
       "      <th>stot_cash_inflows_oper_act</th>\n",
       "      <th>stot_cash_outflows_oper_act</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20100312</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.490274e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.564121e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.321978e+11</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.071380e+10</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.459726e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20091231</td>\n",
       "      <td>408001000</td>\n",
       "      <td>1.577535e+11</td>\n",
       "      <td>1.255598e+11</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20100825</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.426558e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.838394e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.535334e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>1.146239e+10</td>\n",
       "      <td>1.203900e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.991992e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20100630</td>\n",
       "      <td>408001000</td>\n",
       "      <td>4.052371e+10</td>\n",
       "      <td>4.355715e+10</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20110225</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.275000e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.466054e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.165075e+11</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.120694e+10</td>\n",
       "      <td>2.218199e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.069659e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20101231</td>\n",
       "      <td>408001000</td>\n",
       "      <td>1.486299e+11</td>\n",
       "      <td>1.268836e+11</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20111026</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.411571e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-3.427133e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.152976e+11</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2.676739e+10</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.981977e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20110930</td>\n",
       "      <td>408001000</td>\n",
       "      <td>2.234589e+11</td>\n",
       "      <td>2.055972e+11</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20100429</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3.056250e+08</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-6.750866e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.956215e+10</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>5.525798e+09</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.514769e+09</td>\n",
       "      <td>0.0</td>\n",
       "      <td>20100331</td>\n",
       "      <td>408001000</td>\n",
       "      <td>3.956118e+10</td>\n",
       "      <td>3.095155e+10</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   ann_date  cash_recp_prem_orig_inco  cash_recp_return_invest  \\\n",
       "0  20100312                       0.0             2.490274e+09   \n",
       "1  20100825                       0.0             1.426558e+09   \n",
       "2  20110225                       0.0             3.275000e+09   \n",
       "3  20111026                       0.0             3.411571e+09   \n",
       "4  20100429                       0.0             3.056250e+08   \n",
       "\n",
       "   cash_recp_sg_and_rs  conv_corp_bonds_due_within_1y  \\\n",
       "0                  0.0                            0.0   \n",
       "1                  0.0                            0.0   \n",
       "2                  0.0                            0.0   \n",
       "3                  0.0                            0.0   \n",
       "4                  0.0                            0.0   \n",
       "\n",
       "   incl_dvd_profit_paid_sc_ms  net_cash_flows_inv_act  \\\n",
       "0                         0.0           -1.564121e+10   \n",
       "1                         0.0           -1.838394e+09   \n",
       "2                         0.0           -1.466054e+10   \n",
       "3                         0.0           -3.427133e+10   \n",
       "4                         0.0           -6.750866e+09   \n",
       "\n",
       "   net_cash_received_reinsu_bus  net_incr_dep_cob  net_incr_disp_tfa  \\\n",
       "0                           0.0      1.321978e+11                0.0   \n",
       "1                           0.0      2.535334e+10                0.0   \n",
       "2                           0.0      1.165075e+11                0.0   \n",
       "3                           0.0      1.152976e+11                0.0   \n",
       "4                           0.0      2.956215e+10                0.0   \n",
       "\n",
       "     ...      net_incr_int_handling_chrg  net_incr_loans_central_bank  \\\n",
       "0    ...                    2.071380e+10                 0.000000e+00   \n",
       "1    ...                    1.146239e+10                 1.203900e+09   \n",
       "2    ...                    2.120694e+10                 2.218199e+09   \n",
       "3    ...                    2.676739e+10                 0.000000e+00   \n",
       "4    ...                    5.525798e+09                 0.000000e+00   \n",
       "\n",
       "   other_cash_recp_ral_fnc_act  other_cash_recp_ral_oper_act  recp_tax_rends  \\\n",
       "0                          0.0                  1.459726e+09             0.0   \n",
       "1                          0.0                  1.991992e+09             0.0   \n",
       "2                          0.0                  3.069659e+09             0.0   \n",
       "3                          0.0                  1.981977e+09             0.0   \n",
       "4                          0.0                  1.514769e+09             0.0   \n",
       "\n",
       "   report_date  report_type  stot_cash_inflows_oper_act  \\\n",
       "0     20091231    408001000                1.577535e+11   \n",
       "1     20100630    408001000                4.052371e+10   \n",
       "2     20101231    408001000                1.486299e+11   \n",
       "3     20110930    408001000                2.234589e+11   \n",
       "4     20100331    408001000                3.956118e+10   \n",
       "\n",
       "  stot_cash_outflows_oper_act     symbol  \n",
       "0                1.255598e+11  000001.SZ  \n",
       "1                4.355715e+10  000001.SZ  \n",
       "2                1.268836e+11  000001.SZ  \n",
       "3                2.055972e+11  000001.SZ  \n",
       "4                3.095155e+10  000001.SZ  \n",
       "\n",
       "[5 rows x 22 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df,msg = ds.query_lb_fin_stat(type_='cash_flow', \n",
    "                              symbol=\"000001.SZ,000002.SZ\",\n",
    "                              start_date=20100101,\n",
    "                              end_date=20120101, \n",
    "                              fields=\"conv_corp_bonds_due_within_1y\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_lb_dailyindicator\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_lb_dailyindicator(symbol, start_date, end_date, fields=\"\") `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取日行情估值数据\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SH,600300.SH'|\n",
    "|start_date |是 |int |开始时间 YYYMMDD|\n",
    "|end_date |是 |int |结束时间 YYYMMDD|\n",
    "|fields |是| str |字段 以 ','隔开|\n",
    "\n",
    "\n",
    "- fields为必须参数,可选字段可通过ds.query(view=\"help.apiParam\",fields=\"\",filter=\"api=lb.secDailyIndicator\") 查询详细释义\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n",
    "    \n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>api</th>\n",
       "      <th>comment</th>\n",
       "      <th>dtype</th>\n",
       "      <th>must</th>\n",
       "      <th>param</th>\n",
       "      <th>pname</th>\n",
       "      <th>ptype</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>String</td>\n",
       "      <td>N</td>\n",
       "      <td>symbol</td>\n",
       "      <td>证券代码</td>\n",
       "      <td>IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>String</td>\n",
       "      <td>N</td>\n",
       "      <td>start_date</td>\n",
       "      <td>公告开始日期</td>\n",
       "      <td>IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>String</td>\n",
       "      <td>N</td>\n",
       "      <td>end_date</td>\n",
       "      <td>公告结束日期</td>\n",
       "      <td>IN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>ncf_oper_ttm</td>\n",
       "      <td>经营活动产生的现金流量净额(TTM)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>ncf_oper_lyr</td>\n",
       "      <td>经营活动产生的现金流量净额(LYR)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>oper_rev_ttm</td>\n",
       "      <td>营业收入(TTM)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>oper_rev_lyr</td>\n",
       "      <td>营业收入(LYR)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Int</td>\n",
       "      <td>N</td>\n",
       "      <td>limit_status</td>\n",
       "      <td>涨跌停状态</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>String</td>\n",
       "      <td>Y</td>\n",
       "      <td>symbol</td>\n",
       "      <td>证券代码</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>String</td>\n",
       "      <td>N</td>\n",
       "      <td>trade_date</td>\n",
       "      <td>交易日期</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>total_mv</td>\n",
       "      <td>当日总市值</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>float_mv</td>\n",
       "      <td>当日流通市值</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>pe</td>\n",
       "      <td>市盈率</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>pb</td>\n",
       "      <td>市净率</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>pe_ttm</td>\n",
       "      <td>市盈率TTM</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>pcf_ocf</td>\n",
       "      <td>市现率(PCF,经营现金流)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>pcf_ocfttm</td>\n",
       "      <td>市现率(PCF,经营现金流TTM)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>pcf_ncf</td>\n",
       "      <td>市现率(PCF,现金净流量)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>pcf_ncfttm</td>\n",
       "      <td>市现率(PCF,现金净流量TTM)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>ps</td>\n",
       "      <td>市销率(PS)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>ps_ttm</td>\n",
       "      <td>市销率(PS,TTM)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>turnover_ratio</td>\n",
       "      <td>换手率</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>free_turnover_ratio</td>\n",
       "      <td>换手率(自由流通股本)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>total_share</td>\n",
       "      <td>当日总股本</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>float_share</td>\n",
       "      <td>当日流通股本</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>close</td>\n",
       "      <td>当日收盘价</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>price_div_dps</td>\n",
       "      <td>股价/每股派息</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>free_share</td>\n",
       "      <td>当日自由流通股本</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>np_parent_comp_ttm</td>\n",
       "      <td>归属母公司净利润(TTM)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>np_parent_comp_lyr</td>\n",
       "      <td>归属母公司净利润(LYR)</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>lb.secDailyIndicator</td>\n",
       "      <td></td>\n",
       "      <td>Double</td>\n",
       "      <td>N</td>\n",
       "      <td>net_assets</td>\n",
       "      <td>当日净资产</td>\n",
       "      <td>OUT</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     api comment   dtype must                param  \\\n",
       "0   lb.secDailyIndicator          String    N               symbol   \n",
       "1   lb.secDailyIndicator          String    N           start_date   \n",
       "2   lb.secDailyIndicator          String    N             end_date   \n",
       "3   lb.secDailyIndicator          Double    N         ncf_oper_ttm   \n",
       "4   lb.secDailyIndicator          Double    N         ncf_oper_lyr   \n",
       "5   lb.secDailyIndicator          Double    N         oper_rev_ttm   \n",
       "6   lb.secDailyIndicator          Double    N         oper_rev_lyr   \n",
       "7   lb.secDailyIndicator             Int    N         limit_status   \n",
       "8   lb.secDailyIndicator          String    Y               symbol   \n",
       "9   lb.secDailyIndicator          String    N           trade_date   \n",
       "10  lb.secDailyIndicator          Double    N             total_mv   \n",
       "11  lb.secDailyIndicator          Double    N             float_mv   \n",
       "12  lb.secDailyIndicator          Double    N                   pe   \n",
       "13  lb.secDailyIndicator          Double    N                   pb   \n",
       "14  lb.secDailyIndicator          Double    N               pe_ttm   \n",
       "15  lb.secDailyIndicator          Double    N              pcf_ocf   \n",
       "16  lb.secDailyIndicator          Double    N           pcf_ocfttm   \n",
       "17  lb.secDailyIndicator          Double    N              pcf_ncf   \n",
       "18  lb.secDailyIndicator          Double    N           pcf_ncfttm   \n",
       "19  lb.secDailyIndicator          Double    N                   ps   \n",
       "20  lb.secDailyIndicator          Double    N               ps_ttm   \n",
       "21  lb.secDailyIndicator          Double    N       turnover_ratio   \n",
       "22  lb.secDailyIndicator          Double    N  free_turnover_ratio   \n",
       "23  lb.secDailyIndicator          Double    N          total_share   \n",
       "24  lb.secDailyIndicator          Double    N          float_share   \n",
       "25  lb.secDailyIndicator          Double    N                close   \n",
       "26  lb.secDailyIndicator          Double    N        price_div_dps   \n",
       "27  lb.secDailyIndicator          Double    N           free_share   \n",
       "28  lb.secDailyIndicator          Double    N   np_parent_comp_ttm   \n",
       "29  lb.secDailyIndicator          Double    N   np_parent_comp_lyr   \n",
       "30  lb.secDailyIndicator          Double    N           net_assets   \n",
       "\n",
       "                 pname ptype  \n",
       "0                 证券代码    IN  \n",
       "1               公告开始日期    IN  \n",
       "2               公告结束日期    IN  \n",
       "3   经营活动产生的现金流量净额(TTM)   OUT  \n",
       "4   经营活动产生的现金流量净额(LYR)   OUT  \n",
       "5            营业收入(TTM)   OUT  \n",
       "6            营业收入(LYR)   OUT  \n",
       "7                涨跌停状态   OUT  \n",
       "8                 证券代码   OUT  \n",
       "9                 交易日期   OUT  \n",
       "10               当日总市值   OUT  \n",
       "11              当日流通市值   OUT  \n",
       "12                 市盈率   OUT  \n",
       "13                 市净率   OUT  \n",
       "14              市盈率TTM   OUT  \n",
       "15      市现率(PCF,经营现金流)   OUT  \n",
       "16   市现率(PCF,经营现金流TTM)   OUT  \n",
       "17      市现率(PCF,现金净流量)   OUT  \n",
       "18   市现率(PCF,现金净流量TTM)   OUT  \n",
       "19             市销率(PS)   OUT  \n",
       "20         市销率(PS,TTM)   OUT  \n",
       "21                 换手率   OUT  \n",
       "22         换手率(自由流通股本)   OUT  \n",
       "23               当日总股本   OUT  \n",
       "24              当日流通股本   OUT  \n",
       "25               当日收盘价   OUT  \n",
       "26             股价/每股派息   OUT  \n",
       "27            当日自由流通股本   OUT  \n",
       "28       归属母公司净利润(TTM)   OUT  \n",
       "29       归属母公司净利润(LYR)   OUT  \n",
       "30               当日净资产   OUT  "
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df ,msg = ds.query(view=\"help.apiParam\",fields=\"\",filter=\"api=lb.secDailyIndicator\") # 查询现金流量表可选字段\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>float_mv</th>\n",
       "      <th>limit_status</th>\n",
       "      <th>net_assets</th>\n",
       "      <th>pb</th>\n",
       "      <th>pcf_ocf</th>\n",
       "      <th>pe</th>\n",
       "      <th>price_div_dps</th>\n",
       "      <th>ps</th>\n",
       "      <th>symbol</th>\n",
       "      <th>total_mv</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>7.126066e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>1.908844e+10</td>\n",
       "      <td>3.9647</td>\n",
       "      <td>3.1089</td>\n",
       "      <td>123.2494</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.2146</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>7.567942e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>7.126066e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>1.908844e+10</td>\n",
       "      <td>3.9647</td>\n",
       "      <td>3.1089</td>\n",
       "      <td>123.2494</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.2146</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>7.567942e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>7.126066e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>1.908844e+10</td>\n",
       "      <td>3.9647</td>\n",
       "      <td>3.1089</td>\n",
       "      <td>123.2494</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.2146</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>7.567942e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>6.933075e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>1.908844e+10</td>\n",
       "      <td>3.8573</td>\n",
       "      <td>3.0247</td>\n",
       "      <td>119.9115</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5.0733</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>7.362983e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6.813186e+06</td>\n",
       "      <td>0</td>\n",
       "      <td>1.908844e+10</td>\n",
       "      <td>3.7906</td>\n",
       "      <td>2.9724</td>\n",
       "      <td>117.8379</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.9856</td>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>7.235661e+06</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       float_mv  limit_status    net_assets      pb  pcf_ocf        pe  \\\n",
       "0  7.126066e+06             0  1.908844e+10  3.9647   3.1089  123.2494   \n",
       "1  7.126066e+06             0  1.908844e+10  3.9647   3.1089  123.2494   \n",
       "2  7.126066e+06             0  1.908844e+10  3.9647   3.1089  123.2494   \n",
       "3  6.933075e+06             0  1.908844e+10  3.8573   3.0247  119.9115   \n",
       "4  6.813186e+06             0  1.908844e+10  3.7906   2.9724  117.8379   \n",
       "\n",
       "   price_div_dps      ps     symbol      total_mv  \n",
       "0            0.0  5.2146  000001.SZ  7.567942e+06  \n",
       "1            0.0  5.2146  000001.SZ  7.567942e+06  \n",
       "2            0.0  5.2146  000001.SZ  7.567942e+06  \n",
       "3            0.0  5.0733  000001.SZ  7.362983e+06  \n",
       "4            0.0  4.9856  000001.SZ  7.235661e+06  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df,msg = ds.query_lb_dailyindicator(\n",
    "                              symbol=\"000001.SZ,000002.SZ\",\n",
    "                              start_date=20100101,\n",
    "                              end_date=20120101, \n",
    "                              fields=\"pb,pe,ps,pcf_ocf,float_mv,total_mv,net_assets,price_div_dps,limit_status\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_index_weights_raw\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_index_weights_raw(index, trade_date) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取指数某一天的成分股和对应权重\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|index|是 |string|指数代码,只支持单标的|\n",
    "|trade_date |是 |int |交易日|\n",
    "\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>symbol</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>000001.SZ</th>\n",
       "      <td>399300.SZ</td>\n",
       "      <td>20180301</td>\n",
       "      <td>0.008772</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000002.SZ</th>\n",
       "      <td>399300.SZ</td>\n",
       "      <td>20180301</td>\n",
       "      <td>0.013372</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000008.SZ</th>\n",
       "      <td>399300.SZ</td>\n",
       "      <td>20180301</td>\n",
       "      <td>0.001079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000060.SZ</th>\n",
       "      <td>399300.SZ</td>\n",
       "      <td>20180301</td>\n",
       "      <td>0.001433</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000063.SZ</th>\n",
       "      <td>399300.SZ</td>\n",
       "      <td>20180301</td>\n",
       "      <td>0.006531</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          index_code  trade_date    weight\n",
       "symbol                                    \n",
       "000001.SZ  399300.SZ    20180301  0.008772\n",
       "000002.SZ  399300.SZ    20180301  0.013372\n",
       "000008.SZ  399300.SZ    20180301  0.001079\n",
       "000060.SZ  399300.SZ    20180301  0.001433\n",
       "000063.SZ  399300.SZ    20180301  0.006531"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = ds.query_index_weights_raw('000300.SH',trade_date = 20180328)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_index_weights_daily\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_index_weights_daily(index, start_date, end_date) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取指数某段时期内左右的成分股权重\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|index|是 |string|指数代码,只支持单标的|\n",
    "|start_date |是 |int |开始时间 YYMMDD|\n",
    "|end_date |是 |int |结束时间 YYMMDD|\n",
    "\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>symbol</th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "      <th>000008.SZ</th>\n",
       "      <th>000060.SZ</th>\n",
       "      <th>000063.SZ</th>\n",
       "      <th>000069.SZ</th>\n",
       "      <th>000100.SZ</th>\n",
       "      <th>000157.SZ</th>\n",
       "      <th>000166.SZ</th>\n",
       "      <th>000333.SZ</th>\n",
       "      <th>...</th>\n",
       "      <th>601989.SH</th>\n",
       "      <th>601991.SH</th>\n",
       "      <th>601992.SH</th>\n",
       "      <th>601997.SH</th>\n",
       "      <th>601998.SH</th>\n",
       "      <th>603160.SH</th>\n",
       "      <th>603799.SH</th>\n",
       "      <th>603833.SH</th>\n",
       "      <th>603858.SH</th>\n",
       "      <th>603993.SH</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20180102</th>\n",
       "      <td>0.009884</td>\n",
       "      <td>0.013303</td>\n",
       "      <td>0.001246</td>\n",
       "      <td>0.001579</td>\n",
       "      <td>0.007143</td>\n",
       "      <td>0.002455</td>\n",
       "      <td>0.002664</td>\n",
       "      <td>0.001669</td>\n",
       "      <td>0.00272</td>\n",
       "      <td>0.021523</td>\n",
       "      <td>...</td>\n",
       "      <td>0.004842</td>\n",
       "      <td>0.001056</td>\n",
       "      <td>0.001567</td>\n",
       "      <td>0.001581</td>\n",
       "      <td>0.001628</td>\n",
       "      <td>0.000375</td>\n",
       "      <td>0.002016</td>\n",
       "      <td>0.000429</td>\n",
       "      <td>0.000323</td>\n",
       "      <td>0.001545</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180103</th>\n",
       "      <td>0.009884</td>\n",
       "      <td>0.013303</td>\n",
       "      <td>0.001246</td>\n",
       "      <td>0.001579</td>\n",
       "      <td>0.007143</td>\n",
       "      <td>0.002455</td>\n",
       "      <td>0.002664</td>\n",
       "      <td>0.001669</td>\n",
       "      <td>0.00272</td>\n",
       "      <td>0.021523</td>\n",
       "      <td>...</td>\n",
       "      <td>0.004842</td>\n",
       "      <td>0.001056</td>\n",
       "      <td>0.001567</td>\n",
       "      <td>0.001581</td>\n",
       "      <td>0.001628</td>\n",
       "      <td>0.000375</td>\n",
       "      <td>0.002016</td>\n",
       "      <td>0.000429</td>\n",
       "      <td>0.000323</td>\n",
       "      <td>0.001545</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180104</th>\n",
       "      <td>0.009884</td>\n",
       "      <td>0.013303</td>\n",
       "      <td>0.001246</td>\n",
       "      <td>0.001579</td>\n",
       "      <td>0.007143</td>\n",
       "      <td>0.002455</td>\n",
       "      <td>0.002664</td>\n",
       "      <td>0.001669</td>\n",
       "      <td>0.00272</td>\n",
       "      <td>0.021523</td>\n",
       "      <td>...</td>\n",
       "      <td>0.004842</td>\n",
       "      <td>0.001056</td>\n",
       "      <td>0.001567</td>\n",
       "      <td>0.001581</td>\n",
       "      <td>0.001628</td>\n",
       "      <td>0.000375</td>\n",
       "      <td>0.002016</td>\n",
       "      <td>0.000429</td>\n",
       "      <td>0.000323</td>\n",
       "      <td>0.001545</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180105</th>\n",
       "      <td>0.009884</td>\n",
       "      <td>0.013303</td>\n",
       "      <td>0.001246</td>\n",
       "      <td>0.001579</td>\n",
       "      <td>0.007143</td>\n",
       "      <td>0.002455</td>\n",
       "      <td>0.002664</td>\n",
       "      <td>0.001669</td>\n",
       "      <td>0.00272</td>\n",
       "      <td>0.021523</td>\n",
       "      <td>...</td>\n",
       "      <td>0.004842</td>\n",
       "      <td>0.001056</td>\n",
       "      <td>0.001567</td>\n",
       "      <td>0.001581</td>\n",
       "      <td>0.001628</td>\n",
       "      <td>0.000375</td>\n",
       "      <td>0.002016</td>\n",
       "      <td>0.000429</td>\n",
       "      <td>0.000323</td>\n",
       "      <td>0.001545</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180108</th>\n",
       "      <td>0.009884</td>\n",
       "      <td>0.013303</td>\n",
       "      <td>0.001246</td>\n",
       "      <td>0.001579</td>\n",
       "      <td>0.007143</td>\n",
       "      <td>0.002455</td>\n",
       "      <td>0.002664</td>\n",
       "      <td>0.001669</td>\n",
       "      <td>0.00272</td>\n",
       "      <td>0.021523</td>\n",
       "      <td>...</td>\n",
       "      <td>0.004842</td>\n",
       "      <td>0.001056</td>\n",
       "      <td>0.001567</td>\n",
       "      <td>0.001581</td>\n",
       "      <td>0.001628</td>\n",
       "      <td>0.000375</td>\n",
       "      <td>0.002016</td>\n",
       "      <td>0.000429</td>\n",
       "      <td>0.000323</td>\n",
       "      <td>0.001545</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 300 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "symbol      000001.SZ  000002.SZ  000008.SZ  000060.SZ  000063.SZ  000069.SZ  \\\n",
       "trade_date                                                                     \n",
       "20180102     0.009884   0.013303   0.001246   0.001579   0.007143   0.002455   \n",
       "20180103     0.009884   0.013303   0.001246   0.001579   0.007143   0.002455   \n",
       "20180104     0.009884   0.013303   0.001246   0.001579   0.007143   0.002455   \n",
       "20180105     0.009884   0.013303   0.001246   0.001579   0.007143   0.002455   \n",
       "20180108     0.009884   0.013303   0.001246   0.001579   0.007143   0.002455   \n",
       "\n",
       "symbol      000100.SZ  000157.SZ  000166.SZ  000333.SZ    ...      601989.SH  \\\n",
       "trade_date                                                ...                  \n",
       "20180102     0.002664   0.001669    0.00272   0.021523    ...       0.004842   \n",
       "20180103     0.002664   0.001669    0.00272   0.021523    ...       0.004842   \n",
       "20180104     0.002664   0.001669    0.00272   0.021523    ...       0.004842   \n",
       "20180105     0.002664   0.001669    0.00272   0.021523    ...       0.004842   \n",
       "20180108     0.002664   0.001669    0.00272   0.021523    ...       0.004842   \n",
       "\n",
       "symbol      601991.SH  601992.SH  601997.SH  601998.SH  603160.SH  603799.SH  \\\n",
       "trade_date                                                                     \n",
       "20180102     0.001056   0.001567   0.001581   0.001628   0.000375   0.002016   \n",
       "20180103     0.001056   0.001567   0.001581   0.001628   0.000375   0.002016   \n",
       "20180104     0.001056   0.001567   0.001581   0.001628   0.000375   0.002016   \n",
       "20180105     0.001056   0.001567   0.001581   0.001628   0.000375   0.002016   \n",
       "20180108     0.001056   0.001567   0.001581   0.001628   0.000375   0.002016   \n",
       "\n",
       "symbol      603833.SH  603858.SH  603993.SH  \n",
       "trade_date                                   \n",
       "20180102     0.000429   0.000323   0.001545  \n",
       "20180103     0.000429   0.000323   0.001545  \n",
       "20180104     0.000429   0.000323   0.001545  \n",
       "20180105     0.000429   0.000323   0.001545  \n",
       "20180108     0.000429   0.000323   0.001545  \n",
       "\n",
       "[5 rows x 300 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = ds.query_index_weights_daily('000300.SH',start_date=20171231,end_date= 20180328)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_index_member\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_index_member(index, start_date, end_date) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取指数某段时间内的成分股代码\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|index|是 |string|指数代码,只支持单标的|\n",
    "|start_date |是 |int |开始时间 YYMMDD|\n",
    "|end_date |是 |int |结束时间 YYMMDD|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "list\n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['000001.SZ', '000002.SZ', '000008.SZ', '000060.SZ', '000063.SZ']"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = ds.query_index_member('000300.SH',start_date=20171231,end_date= 20180328)\n",
    "df[:5]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_index_member_daily\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_index_member_daily(index, start_date, end_date) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 获取指数某段时间内的成分股及具体某天该成分股是否在其中\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|index|是 |string|指数代码,只支持单标的|\n",
    "|start_date |是 |int |开始时间 YYMMDD|\n",
    "|end_date |是 |int |结束时间 YYMMDD|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    " df : pd.DataFrame\n",
    "    \n",
    "        index dates, columns all securities that have ever been components,\n",
    "        values are 0 (not in) or 1 (in)\n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "      <th>000008.SZ</th>\n",
       "      <th>000060.SZ</th>\n",
       "      <th>000063.SZ</th>\n",
       "      <th>000069.SZ</th>\n",
       "      <th>000100.SZ</th>\n",
       "      <th>000157.SZ</th>\n",
       "      <th>000166.SZ</th>\n",
       "      <th>000333.SZ</th>\n",
       "      <th>...</th>\n",
       "      <th>601989.SH</th>\n",
       "      <th>601991.SH</th>\n",
       "      <th>601992.SH</th>\n",
       "      <th>601997.SH</th>\n",
       "      <th>601998.SH</th>\n",
       "      <th>603160.SH</th>\n",
       "      <th>603799.SH</th>\n",
       "      <th>603833.SH</th>\n",
       "      <th>603858.SH</th>\n",
       "      <th>603993.SH</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20180102</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180103</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180104</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180105</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180108</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 300 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            000001.SZ  000002.SZ  000008.SZ  000060.SZ  000063.SZ  000069.SZ  \\\n",
       "trade_date                                                                     \n",
       "20180102            1          1          1          1          1          1   \n",
       "20180103            1          1          1          1          1          1   \n",
       "20180104            1          1          1          1          1          1   \n",
       "20180105            1          1          1          1          1          1   \n",
       "20180108            1          1          1          1          1          1   \n",
       "\n",
       "            000100.SZ  000157.SZ  000166.SZ  000333.SZ    ...      601989.SH  \\\n",
       "trade_date                                                ...                  \n",
       "20180102            1          1          1          1    ...              1   \n",
       "20180103            1          1          1          1    ...              1   \n",
       "20180104            1          1          1          1    ...              1   \n",
       "20180105            1          1          1          1    ...              1   \n",
       "20180108            1          1          1          1    ...              1   \n",
       "\n",
       "            601991.SH  601992.SH  601997.SH  601998.SH  603160.SH  603799.SH  \\\n",
       "trade_date                                                                     \n",
       "20180102            1          1          1          1          1          1   \n",
       "20180103            1          1          1          1          1          1   \n",
       "20180104            1          1          1          1          1          1   \n",
       "20180105            1          1          1          1          1          1   \n",
       "20180108            1          1          1          1          1          1   \n",
       "\n",
       "            603833.SH  603858.SH  603993.SH  \n",
       "trade_date                                   \n",
       "20180102            1          1          1  \n",
       "20180103            1          1          1  \n",
       "20180104            1          1          1  \n",
       "20180105            1          1          1  \n",
       "20180108            1          1          1  \n",
       "\n",
       "[5 rows x 300 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = ds.query_index_member_daily('000300.SH',start_date=20171231,end_date= 20180328)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_industry_daily\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_industry_daily(symbol, start_date, end_date, type_='SW', level=1) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 指定一系列股票，获取它们在某段时间的行业分类代码\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SZ,000002.SZ'|\n",
    "|start_date |是 |int |开始时间 YYYMMDD|\n",
    "|end_date |是 |int |结束时间 YYYMMDD|\n",
    "|type_ |否|string| 行业分类标准 目前支持\"SW\"（申万）,\"ZZ\"（中证）,\"ZJH\"（证监会），默认\"SW\"|\n",
    "|level |否|int| 行业等级 默认1|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    " df : pd.DataFrame\n",
    "    \n",
    "        index dates, columns symbols\n",
    "        values are industry code\n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20180102</th>\n",
       "      <td>货币金融服务</td>\n",
       "      <td>房地产业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180103</th>\n",
       "      <td>货币金融服务</td>\n",
       "      <td>房地产业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180104</th>\n",
       "      <td>货币金融服务</td>\n",
       "      <td>房地产业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180105</th>\n",
       "      <td>货币金融服务</td>\n",
       "      <td>房地产业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20180108</th>\n",
       "      <td>货币金融服务</td>\n",
       "      <td>房地产业</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         000001.SZ 000002.SZ\n",
       "20180102    货币金融服务      房地产业\n",
       "20180103    货币金融服务      房地产业\n",
       "20180104    货币金融服务      房地产业\n",
       "20180105    货币金融服务      房地产业\n",
       "20180108    货币金融服务      房地产业"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = ds.query_industry_daily('000001.SZ,000002.SZ',start_date=20171231,end_date= 20180328,\n",
    "                            type_=\"ZJH\",level=2)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_industry_raw\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_industry_raw(symbol, type_='SW', level=1) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 指定一系列股票，获取它们的行业分类代码\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SZ,000002.SZ'|\n",
    "|type_ |否|string| 行业分类标准 目前支持\"SW\"（申万）,\"ZZ\"（中证）,\"ZJH\"（证监会），默认\"SW\"|\n",
    "|level |否|int| 行业等级 默认1|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    " df : pd.DataFrame\n",
    "    \n",
    "    \n",
    "**示例：**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>in_date</th>\n",
       "      <th>industry1_code</th>\n",
       "      <th>industry1_name</th>\n",
       "      <th>industry2_code</th>\n",
       "      <th>industry2_name</th>\n",
       "      <th>industry3_code</th>\n",
       "      <th>industry3_name</th>\n",
       "      <th>industry4_code</th>\n",
       "      <th>industry4_name</th>\n",
       "      <th>industry_src</th>\n",
       "      <th>out_date</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20121231</td>\n",
       "      <td>J</td>\n",
       "      <td>金融业</td>\n",
       "      <td>J66</td>\n",
       "      <td>货币金融服务</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>zjh</td>\n",
       "      <td></td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20121231</td>\n",
       "      <td>K</td>\n",
       "      <td>房地产业</td>\n",
       "      <td>K70</td>\n",
       "      <td>房地产业</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>zjh</td>\n",
       "      <td></td>\n",
       "      <td>000002.SZ</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    in_date industry1_code industry1_name industry2_code industry2_name  \\\n",
       "0  20121231              J            金融业            J66         货币金融服务   \n",
       "1  20121231              K           房地产业            K70           房地产业   \n",
       "\n",
       "  industry3_code industry3_name industry4_code industry4_name industry_src  \\\n",
       "0                                                                      zjh   \n",
       "1                                                                      zjh   \n",
       "\n",
       "  out_date     symbol  \n",
       "0           000001.SZ  \n",
       "1           000002.SZ  "
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = ds.query_industry_raw('000001.SZ,000002.SZ',\n",
    "                            type_=\"ZJH\",level=2)\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_adj_factor_daily\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_adj_factor_daily(symbol, start_date, end_date, div=False) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 查询股票复权因子\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SZ,000002.SZ'|\n",
    "|start_date |是 |int |开始时间 YYYMMDD|\n",
    "|end_date |是 |int |结束时间 YYYMMDD|\n",
    "|div|否|bool|是否返回相对前一日复权因子的比值，默认False(原复权因子)|\n",
    "\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    " df : pd.DataFrame\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>000001.SZ</th>\n",
       "      <th>000002.SZ</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20150105</th>\n",
       "      <td>68.1803</td>\n",
       "      <td>114.776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20150106</th>\n",
       "      <td>68.1803</td>\n",
       "      <td>114.776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20150107</th>\n",
       "      <td>68.1803</td>\n",
       "      <td>114.776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20150108</th>\n",
       "      <td>68.1803</td>\n",
       "      <td>114.776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20150109</th>\n",
       "      <td>68.1803</td>\n",
       "      <td>114.776</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          000001.SZ  000002.SZ\n",
       "20150105    68.1803    114.776\n",
       "20150106    68.1803    114.776\n",
       "20150107    68.1803    114.776\n",
       "20150108    68.1803    114.776\n",
       "20150109    68.1803    114.776"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = ds.query_adj_factor_daily('000001.SZ,000002.SZ',\n",
    "                               start_date=20150101,end_date=20160101,\n",
    "                               div=False)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_dividend\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_dividend(symbol, start_date, end_date) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 查询分红送股信息\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SZ,000002.SZ'|\n",
    "|start_date |是 |int |开始时间 YYYMMDD|\n",
    "|end_date |是 |int |结束时间 YYYMMDD|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ann_date</th>\n",
       "      <th>bonus_list_date</th>\n",
       "      <th>cash</th>\n",
       "      <th>cash_tax</th>\n",
       "      <th>cashpay_date</th>\n",
       "      <th>div_enddate</th>\n",
       "      <th>exdiv_date</th>\n",
       "      <th>publish_date</th>\n",
       "      <th>record_date</th>\n",
       "      <th>share_ratio</th>\n",
       "      <th>share_trans_ratio</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20150313</td>\n",
       "      <td>20150413</td>\n",
       "      <td>0.174</td>\n",
       "      <td>0.1653</td>\n",
       "      <td>20150413</td>\n",
       "      <td>20141231</td>\n",
       "      <td>20150413</td>\n",
       "      <td>20150407</td>\n",
       "      <td>20150410</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.2</td>\n",
       "      <td>000001.SZ</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20150331</td>\n",
       "      <td></td>\n",
       "      <td>0.500</td>\n",
       "      <td>0.4750</td>\n",
       "      <td>20150721</td>\n",
       "      <td>20141231</td>\n",
       "      <td>20150721</td>\n",
       "      <td>20150714</td>\n",
       "      <td>20150720</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>000002.SZ</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   ann_date bonus_list_date   cash  cash_tax cashpay_date div_enddate  \\\n",
       "0  20150313        20150413  0.174    0.1653     20150413    20141231   \n",
       "1  20150331                  0.500    0.4750     20150721    20141231   \n",
       "\n",
       "   exdiv_date  publish_date  record_date  share_ratio  share_trans_ratio  \\\n",
       "0    20150413      20150407     20150410          0.0                0.2   \n",
       "1    20150721      20150714     20150720          0.0                0.0   \n",
       "\n",
       "      symbol  \n",
       "0  000001.SZ  \n",
       "1  000002.SZ  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df,msg = ds.query_dividend('000001.SZ,000002.SZ',\n",
    "                           start_date=20150101,end_date=20160101)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_inst_info\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_inst_info(symbol, inst_type=\"\", fields=\"\") `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 查询证券基本信息\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|symbol|是 |string|标的代码，多标的以','隔开，如'000001.SZ,000002.SZ'|\n",
    "|inst_type |否 |string |证券类型 \"1,2,3,4,5,100,101,102,103,104\",默认全部|\n",
    "|fields |是| str |字段 以 ','隔开，默认\"\"|\n",
    "\n",
    "inst_type具体类型如下:\n",
    "\n",
    "|类型编号（inst_type）|类型|\n",
    "|:----    |---|\n",
    "|1\t|股票|\n",
    "|10|回购|\n",
    "|100|指数|\n",
    "|101|股指期货|\n",
    "|102|国债期货|\n",
    "|103|商品期货|\n",
    "|104|现货递延|\n",
    "|105|SPREAD价差|\n",
    "|11|国债|\n",
    "|12|地方政府债|\n",
    "|13\t|金融债|\n",
    "|14|企业债|\n",
    "|15|公司债|\n",
    "|16|资产支持证券|\n",
    "|17|可交换债|\n",
    "|18|可分离转债存债|\n",
    "|19\t|政府支持机构债|\n",
    "|2|封闭式基金|\n",
    "|20|转股换股|\n",
    "|201|股指ETF期权|\n",
    "|202|股指期货期权|\n",
    "|203|商品期货期权|\n",
    "|3\t|LOF基金|\n",
    "|4|ETF基金|\n",
    "|5|分级基金|\n",
    "|6|国债商品|\n",
    "|7\t|商品|\n",
    "|8|可转债|\n",
    "|9|BASKET|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "df : pd.DataFrame\n",
    "\n",
    "err_msg : str\n",
    "    error code and error message joined by comma\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>buylot</th>\n",
       "      <th>delist_date</th>\n",
       "      <th>inst_type</th>\n",
       "      <th>list_date</th>\n",
       "      <th>market</th>\n",
       "      <th>multiplier</th>\n",
       "      <th>name</th>\n",
       "      <th>pricetick</th>\n",
       "      <th>product</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>symbol</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>000001.SH</th>\n",
       "      <td>100</td>\n",
       "      <td>99999999</td>\n",
       "      <td>100</td>\n",
       "      <td>0</td>\n",
       "      <td>SH</td>\n",
       "      <td>1</td>\n",
       "      <td>上证指数</td>\n",
       "      <td>0.01</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000001.SZ</th>\n",
       "      <td>100</td>\n",
       "      <td>99999999</td>\n",
       "      <td>1</td>\n",
       "      <td>19910403</td>\n",
       "      <td>SZ</td>\n",
       "      <td>1</td>\n",
       "      <td>平安银行</td>\n",
       "      <td>0.01</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000002.SZ</th>\n",
       "      <td>100</td>\n",
       "      <td>99999999</td>\n",
       "      <td>1</td>\n",
       "      <td>19910129</td>\n",
       "      <td>SZ</td>\n",
       "      <td>1</td>\n",
       "      <td>万  科Ａ</td>\n",
       "      <td>0.01</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           buylot  delist_date  inst_type  list_date market  multiplier  \\\n",
       "symbol                                                                    \n",
       "000001.SH     100     99999999        100          0     SH           1   \n",
       "000001.SZ     100     99999999          1   19910403     SZ           1   \n",
       "000002.SZ     100     99999999          1   19910129     SZ           1   \n",
       "\n",
       "            name  pricetick product  \n",
       "symbol                               \n",
       "000001.SH   上证指数       0.01          \n",
       "000001.SZ   平安银行       0.01          \n",
       "000002.SZ  万  科Ａ       0.01          "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fields = \"buylot,delist_date,inst_type,list_date,multiplier,name,pricetick,product,market\"\n",
    "df = ds.query_inst_info('000001.SZ,000002.SZ,000001.SH', inst_type=\"\", fields=fields)\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_trade_dates\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_trade_dates(start_date, end_date) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 某段时间范围内的交易日\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|start_date |是 |int |开始时间 YYYMMDD|\n",
    "|end_date |是 |int |结束时间 YYYMMDD|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "trade_dates_arr : np.ndarray\n",
    "           \n",
    "           dtype = int\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([20170103, 20170104, 20170105, 20170106, 20170109, 20170110,\n",
       "       20170111, 20170112, 20170113, 20170116, 20170117, 20170118,\n",
       "       20170119, 20170120, 20170123, 20170124, 20170125, 20170126,\n",
       "       20170203, 20170206, 20170207, 20170208, 20170209, 20170210,\n",
       "       20170213, 20170214, 20170215, 20170216, 20170217, 20170220,\n",
       "       20170221, 20170222, 20170223, 20170224, 20170227, 20170228,\n",
       "       20170301, 20170302, 20170303, 20170306, 20170307, 20170308,\n",
       "       20170309, 20170310, 20170313, 20170314, 20170315, 20170316,\n",
       "       20170317, 20170320, 20170321, 20170322, 20170323, 20170324,\n",
       "       20170327, 20170328, 20170329, 20170330, 20170331, 20170405,\n",
       "       20170406, 20170407, 20170410, 20170411, 20170412, 20170413,\n",
       "       20170414, 20170417, 20170418, 20170419, 20170420, 20170421,\n",
       "       20170424, 20170425, 20170426, 20170427, 20170428])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds.query_trade_dates(20170101,20170501)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_last_trade_date\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_last_trade_date(date) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 离某天最近的上一个交易日\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|date |是 |int | |\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "int 最近的上一个交易日\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20170505"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds.query_last_trade_date(20170508)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## query_next_trade_date\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.query_next_trade_date(date, n=1) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 离某天最近的下n个交易日\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|date |是 |int | |\n",
    "|n |否 |int |下n个交易日 默认为1|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "int 最近的下n个交易日\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20170509"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds.query_next_trade_date(20170508,n=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## is_trade_date\n",
    "- ` jaqs_fxdayu.data.dataservice.RemoteDataService.is_trade_date(date) `\n",
    "\n",
    "**简要描述：**\n",
    "\n",
    "- 某天是否是交易日\n",
    "\n",
    "**参数：**\n",
    "\n",
    "|参数名|必选|类型|说明|\n",
    "|:----    |:---|:----- |-----   |\n",
    "|date |是 |int | 日期|\n",
    "\n",
    "\n",
    "** 返回：**\n",
    "\n",
    "bool\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds.is_trade_date(20170508)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [conda env:IIA]",
   "language": "python",
   "name": "conda-env-IIA-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
